Optimal. Leaf size=59 \[ \frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {(a+2 b) \tan (x)}{(a+b)^2}+\frac {\tan ^3(x)}{3 (a+b)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3270, 398, 211}
\begin {gather*} \frac {b^2 \text {ArcTan}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {\tan ^3(x)}{3 (a+b)}+\frac {(a+2 b) \tan (x)}{(a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 398
Rule 3270
Rubi steps
\begin {align*} \int \frac {\sec ^4(x)}{a+b \sin ^2(x)} \, dx &=\text {Subst}\left (\int \frac {\left (1+x^2\right )^2}{a+(a+b) x^2} \, dx,x,\tan (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {a+2 b}{(a+b)^2}+\frac {x^2}{a+b}+\frac {b^2}{(a+b)^2 \left (a+(a+b) x^2\right )}\right ) \, dx,x,\tan (x)\right )\\ &=\frac {(a+2 b) \tan (x)}{(a+b)^2}+\frac {\tan ^3(x)}{3 (a+b)}+\frac {b^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (x)\right )}{(a+b)^2}\\ &=\frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {(a+2 b) \tan (x)}{(a+b)^2}+\frac {\tan ^3(x)}{3 (a+b)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.16, size = 59, normalized size = 1.00 \begin {gather*} \frac {b^2 \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)^{5/2}}+\frac {\left (2 a+5 b+(a+b) \sec ^2(x)\right ) \tan (x)}{3 (a+b)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.27, size = 62, normalized size = 1.05
method | result | size |
default | \(\frac {\frac {a \left (\tan ^{3}\left (x \right )\right )}{3}+\frac {b \left (\tan ^{3}\left (x \right )\right )}{3}+\tan \left (x \right ) a +2 \tan \left (x \right ) b}{\left (a +b \right )^{2}}+\frac {b^{2} \arctan \left (\frac {\left (a +b \right ) \tan \left (x \right )}{\sqrt {a \left (a +b \right )}}\right )}{\left (a +b \right )^{2} \sqrt {a \left (a +b \right )}}\) | \(62\) |
risch | \(\frac {2 i \left (3 b \,{\mathrm e}^{4 i x}+6 a \,{\mathrm e}^{2 i x}+12 b \,{\mathrm e}^{2 i x}+2 a +5 b \right )}{3 \left ({\mathrm e}^{2 i x}+1\right )^{3} \left (a +b \right )^{2}}-\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}-\frac {2 i a^{2}+2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{2 i x}-\frac {-2 i a^{2}-2 i a b +2 a \sqrt {-a^{2}-a b}+b \sqrt {-a^{2}-a b}}{b \sqrt {-a^{2}-a b}}\right )}{2 \sqrt {-a^{2}-a b}\, \left (a +b \right )^{2}}\) | \(224\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 72, normalized size = 1.22 \begin {gather*} \frac {b^{2} \arctan \left (\frac {{\left (a + b\right )} \tan \left (x\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} {\left (a^{2} + 2 \, a b + b^{2}\right )}} + \frac {{\left (a + b\right )} \tan \left (x\right )^{3} + 3 \, {\left (a + 2 \, b\right )} \tan \left (x\right )}{3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 129 vs.
\(2 (49) = 98\).
time = 0.42, size = 343, normalized size = 5.81 \begin {gather*} \left [-\frac {3 \, \sqrt {-a^{2} - a b} b^{2} \cos \left (x\right )^{3} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (x\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (x\right )^{2} + 4 \, {\left ({\left (2 \, a + b\right )} \cos \left (x\right )^{3} - {\left (a + b\right )} \cos \left (x\right )\right )} \sqrt {-a^{2} - a b} \sin \left (x\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (x\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (x\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) - 4 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2} + {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{12 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{3}}, -\frac {3 \, \sqrt {a^{2} + a b} b^{2} \arctan \left (\frac {{\left (2 \, a + b\right )} \cos \left (x\right )^{2} - a - b}{2 \, \sqrt {a^{2} + a b} \cos \left (x\right ) \sin \left (x\right )}\right ) \cos \left (x\right )^{3} - 2 \, {\left (a^{3} + 2 \, a^{2} b + a b^{2} + {\left (2 \, a^{3} + 7 \, a^{2} b + 5 \, a b^{2}\right )} \cos \left (x\right )^{2}\right )} \sin \left (x\right )}{6 \, {\left (a^{4} + 3 \, a^{3} b + 3 \, a^{2} b^{2} + a b^{3}\right )} \cos \left (x\right )^{3}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{4}{\left (x \right )}}{a + b \sin ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 134 vs.
\(2 (49) = 98\).
time = 0.45, size = 134, normalized size = 2.27 \begin {gather*} \frac {{\left (\pi \left \lfloor \frac {x}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (x\right ) + b \tan \left (x\right )}{\sqrt {a^{2} + a b}}\right )\right )} b^{2}}{{\left (a^{2} + 2 \, a b + b^{2}\right )} \sqrt {a^{2} + a b}} + \frac {a^{2} \tan \left (x\right )^{3} + 2 \, a b \tan \left (x\right )^{3} + b^{2} \tan \left (x\right )^{3} + 3 \, a^{2} \tan \left (x\right ) + 9 \, a b \tan \left (x\right ) + 6 \, b^{2} \tan \left (x\right )}{3 \, {\left (a^{3} + 3 \, a^{2} b + 3 \, a b^{2} + b^{3}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 15.02, size = 77, normalized size = 1.31 \begin {gather*} \frac {{\mathrm {tan}\left (x\right )}^3}{3\,\left (a+b\right )}-\mathrm {tan}\left (x\right )\,\left (\frac {a}{{\left (a+b\right )}^2}-\frac {2}{a+b}\right )+\frac {b^2\,\mathrm {atan}\left (\frac {\mathrm {tan}\left (x\right )\,\left (2\,a+2\,b\right )\,\left (a^2+2\,a\,b+b^2\right )}{2\,\sqrt {a}\,{\left (a+b\right )}^{5/2}}\right )}{\sqrt {a}\,{\left (a+b\right )}^{5/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________